package com.hbsd.paopaobackend.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hbsd.paopaobackend.model.domain.Team;
import com.hbsd.paopaobackend.model.domain.User;
import com.hbsd.paopaobackend.model.domain.UserTeam;
import com.hbsd.paopaobackend.model.dto.TeamQuery;
import com.hbsd.paopaobackend.model.request.Team.TeamJoinRequest;
import com.hbsd.paopaobackend.model.request.Team.TeamQuitRequest;
import com.hbsd.paopaobackend.model.request.Team.TeamUploadRequest;
import com.hbsd.paopaobackend.model.vo.TeamUserVO;

import java.util.List;

/**
* @author zzh
* @description 针对表【team(队伍表)】的数据库操作Service

*/
public interface TeamService extends IService<Team> {

    /**
     * 创建队伍
     *
     * @param team
     * @param loginUser
     * @return
     */
    long addTeam(Team team, User loginUser);

    /**
     * 搜索队伍
     *
     * @param teamQuery
     * @param isAdmin
     * @return
     */
    List<TeamUserVO> listTeams(TeamQuery teamQuery, Boolean isAdmin);


    /**
     * 更新队伍信息
     * @param teamUploadRequest
     * @param loginUser
     * @param isAdmin
     * @return
     */
    boolean updateTeam(TeamUploadRequest teamUploadRequest, User loginUser, boolean isAdmin);

    /**
     * 加入队伍
     * @param teamJoinRequest
     * @param loginUser
     * @return
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest, User loginUser);

    /**
     * 退出队伍
     * @param teamQuitRequest
     * @param loginUser
     * @return
     */
    boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

    /**
     * 解散队伍
     * @param teamId
     * @param loginUser
     * @return
     */
    boolean dissolveTeam(Long teamId, User loginUser);

    /**
     * 获取我锁加入的队伍列表
     * @param teamQuery
     * @param loginUser
     * @return
     */
    List<UserTeam> getCurrentJoinTeamList(TeamQuery teamQuery, User loginUser);
}
